<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const obj = { ownProp: "value" };

      console.log(obj.hasOwnProperty("ownProp")); // true (对象自身的属性)
      console.log(obj.hasOwnProperty("toString")); // false (来自原型链的属性)
    </script>
  </body>
</html>
